package se480.tracker.client;

import org.apache.log4j.Logger;

import se480.tracker.event.TrackerEvent;
import se480.tracker.proxy.TrackerProxy;
import se480.tracker.util.OutputFileWriterUtil;

/**
 * Client class for queries 
 * 
 * @author mmichalak
 *
 */
public class QueryClient {
	static Logger logger = Logger.getLogger(QueryClient.class.getName());
	
	TrackerProxy proxy = null;
	
	
	public void sendQuery(TrackerEvent ev) {
		String response = proxy.processRequest(ev);
		logger.debug(response);
		
		OutputFileWriterUtil.writeToFile(response);
	}

	public TrackerProxy getProxy() {
		return proxy;
	}

	public void setProxy(TrackerProxy proxy) {
		this.proxy = proxy;
	}

}
